from mylib.stusys import Stu
while True:
    sys0 = Stu()
    print("=" * 12, "学员管理系统", "=" * 14)
    print("{0:1} {1:13} {2:15}".format(" ", "1. 查看学员信息", "2. 添加学员信息"))
    print("{0:1} {1:13} {2:15}".format(" ", "3. 删除学员信息", "4. 退出系统"))
    print("=" * 40)
    key = input("请输入对应的选择：")
    if key == "1":
        print("=" * 12, "学员信息浏览", "=" * 14)
        sys0.findAll()
        input("按回车键继续：")
    elif key == "2":
        print("=" * 12, "学员信息添加", "=" * 14)
        name = input("请输入要添加的姓名：")
        age = input("请输入要添加的年龄：")
        classid = input("请输入要添加的班级号：")
        data = '"{}",{},"{}"'.format(name, age, classid)
        print(data)
        sys0.insert(data)
        sys0.findAll()
        input("按回车键继续：")
    elif key == "3":
        print("=" * 12, "学员信息删除", "=" * 14)
        sys0.findAll()
        sid = input("请输入你要删除的信息id号：")
        sys0.delete(sid)
        sys0.findAll()
        input("按回车键继续：")
    elif key == "4":
        print("=" * 12, "再见", "=" * 14)
        break
    else:
        print("======== 无效的键盘输入！ ==========")

db.close()